'use strict';

module.exports = collectSameElements;
function collectSameElements(collectionA, objectB) {
let result=[];
let  arr=[];
 arr=objectB.value;
for(let item1 of collectionA){
  for(let item2 of arr){
    if(item1===item2){
      result.push(item1);
    }
  }
}
console.log(result);
return result;

}
collectSameElements( ['a', 'e', 'h', 't', 'f', 'c', 'g', 'b', 'd'], {value: ['a', 'd', 'e', 'f']})